<?php
class ExecutorMachine extends BaseModel 
{
    /**
     * Returns the static model of the specified AR class.
     * @return CActiveRecord the static model class
     */
    public static function model($className=__CLASS__)
    {
        return parent::model($className);
    }

    /**
     * @return string the associated database table name
     */
    public function tableName()
    {
        return 'executor_machine';
    }
    
    public function rules()
    {
        return array(
            array('hostname, max_workers, current_workers', 'required', 'message'=>'{attribute} 不能为空'),
            array('max_workers, current_workers', 'type', 'type' => 'integer', 'message'=>'{attribute} 不是整数'),
        );
    }

    /**
     *
     * @return array customized attribute labels (name=>label)
     */
    public function attributeLabels()
    {
        return array(
            'executor_id' => '编号',
            'hostname' => '机器名',
            'max_workers' => '最大进程数',
            'current_workers' => '当前进程数',
            'state' => '机器状态',
        );
    }
 }
